﻿#include "emotionutility.h"
#include "emotion/smileyanimationemotionconstants.h"
#include "emotion/smileystaticemotionconstants.h"


namespace Utility {

EmotionUtility *EmotionUtility::m_instance = NULL;

EmotionUtility::EmotionUtility(QObject *parent) :
    QObject(parent)
{
}


EmotionUtility::~EmotionUtility()
{
    delete m_instance;
    m_instance = NULL;
}


EmotionUtility *EmotionUtility::instance()
{
    if (m_instance == NULL)
        m_instance = new EmotionUtility();
    return m_instance;
}


QString EmotionUtility::genSmileyAnimationEmotionName(int index)
{
    return QString(SMILEY_ANIMATION_EMOTION_NAME) + "-" + QString::number(index);
}


QString EmotionUtility::staticEmotionPath()
{
    return ":/Image/Emotion/Static/smiley";
}


QString EmotionUtility::genStaticEmotionName(int index)
{
    return QString(SMILEY_STATIC_EMOTION_NAME)+ "-" + QString::number(index);
}


QString EmotionUtility::smileyAnimationEmotionPath()
{
    return ":/Image/Emotion/Animation/smiley";
}


QString EmotionUtility::trollAnimationEmotionPath()
{
    return ":/Image/Emotion/Animation/troll";
}


QString EmotionUtility::comicAnimationEmotionPath()
{
    return ":/Image/Emotion/Animation/comic";
}

} // namespace Utility
